#ifndef _ADS8689_H_
#define _ADS8689_H_
#include "ads8689_driver.h"
#include <linux/gpio.h>
#include <linux/of_gpio.h>
#include <linux/spi/spi.h>
#define Set_Rest_GPIO(x) gpio_set_value(adc_dev.rest_gpio, x) //设置引脚电平
#define RVS gpio_get_value(adc_dev.rvs_gpio)                  //读取引脚电平
#define Set_CS_GPIO(x) gpio_set_value(adc_dev.cs_gpio, x)     //设置引脚电平

/* 定义 ads8689 寄存器变量 */
#define ads_base 0x00
typedef struct 
{
    /* data */
    uint8_t DEVICE_ID_REG;   // 0x00
    uint8_t RST_PWRCTL_REG;  // 0x04
    uint8_t SDI_CTL_REG;     // 0x08 SDI data input control register
    uint8_t SDO_CTL_REG;     // 0Ch SDO-x data input control register
    uint8_t DATAOUT_CTL_REG; // 10h Output data control register
    uint8_t RANGE_SEL_REG;   // 14h Input range selection control register
    uint8_t ALARM_REG;       // 20h ALARM output register
    uint8_t ALARM_H_TH_REG;  // 24h ALARM high threshold and hysteresis register
    uint8_t ALARM_L_TH_REG;  // 28h
}ads8689_register;
#define ads_reg  (ads8689_register*)ads_base;
#endif